package com.xtt.designPattern.future;

/**
 * future模式客户端
 * @author Administrator
 * @description 
 * @createTime 2017年6月22日 下午2:16:41
 */
public class Client {

	public Data request() {
		FutureData futureData = new FutureData();
		new Thread(()->{
			//RealData的构建很慢，所以放在单独的线程中运行
			RealData realData = new RealData();
			futureData.setData(realData);
		}).start();;
		return futureData;
	}
}
